#include "BST.h"
#include <time.h>
#include <iostream>

using namespace std;

int main()
{
	
	int data[] = {8,3,5,9,11,7,2,6,1,4};
	BST tree;
	for (int i = 0; i < sizeof(data)/sizeof(data[0]); ++i)
	{
		tree.Add(data[i]);
	}
	
	//tree.ShowTree();
/*
----11
--9
8
------7
--------6
----5
------4
--3
----2
------1
*/
	cout << "max is " << tree.GetMax() << endl;
	cout << "max is " << tree.GetMin() << endl;
	tree.PreTraverseR();
	tree.PreTraverse();
	tree.MidTraverseR();
	tree.MidTraverse();
	tree.PostTraverseR();
	tree.PostTraverse();

	//delete node
	cout << tree.Del(tree.GetMax()) << endl;
	tree.Del(tree.GetMin());
	//tree.Del(9);
	//tree.Del(3);
	return 0;
}